package top.wangjiu.java.test;


import com.sun.tracing.dtrace.FunctionName;

import java.io.Serializable;

public class Math implements Serializable{
    public static final int num = 90;
    public static int num2 = 100;
    public static User user = new User();
    private long[] arr = new long[9];
    private long base=2;
    private short aShort=3;
    static {
        num2++;
    }
    public Math(long base){
        this.base = base;
    }

    @Deprecated
    public Math(){
    }

    public static void main(String[] args) {
        long b = 10;
        Math math = new Math(b);
        long d = math.addBase(num2);
        System.out.println(d);
    }
    public long addBase(int a){
        long c = 0;
        try{
            c = a + base;
        }catch (Throwable e){
            e.printStackTrace();
        }finally {
            System.out.println("addBase error");
        }
        return c;
    }

    @FunctionName("funName")
    public void strTest(){
        String str1 = new String("top/wangjiu/java/jvm");
        String str2 = "top/wangjiu/java/jvm";
        System.out.println(str1 == str2);
    }

    public void strTest2()throws RuntimeException{
        String str1 = new String("top/wangjiu/java/jvm");
        String str2 = new String("top/wangjiu/java/jvm");
        System.out.println(str1 == str2);
    }

    public void strTest3(){
        String str1 = "top/wangjiu/java/jvm";
        String str2 = "top/wangjiu/java/jvm";
        System.out.println(str1 == str2);
    }
}
